<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Hugo {{ hugo.Version }} with theme Tranquilpeak 0.5.3-BETA">
<meta name="author" content="{{ .Site.Author.name }}">
<meta name="keywords" content="{{ with .Keywords }}{{ delimit . ", " }}{{ end }}{{ if .Site.Params.keywords }}, {{ delimit .Site.Params.keywords ", " }}{{ end }}">
<meta name="description" content="{{ if .Description }}{{ .Description }}{{ else if .IsPage }}{{ .Summary }}{{ else }}{{ .Site.Params.description }}{{ end }}">

<!-- Meta Social -->
<meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else if .IsPage }}{{ .Summary }}{{ else }}{{ .Site.Params.description }}{{ end }}">
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
<meta property="og:title" content="{{ with .Title }}{{ . }}{{ else }}{{ .Site.Title }}{{ end }}">
<meta name="twitter:title" content="{{ with .Title }}{{ . }}{{ else }}{{ .Site.Title }}{{ end }}">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="twitter:url" content="{{ .Permalink }}">
<meta property="og:site_name" content="{{ .Site.Title }}">
<meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else if .IsPage }}{{ .Summary }}{{ else }}{{ .Site.Params.description }}{{ end }}">
<meta name="twitter:description" content="{{ if .Description }}{{ .Description }}{{ else if .IsPage }}{{ .Summary }}{{ else }}{{ .Site.Params.description }}{{ end }}">
<meta property="og:locale" content="{{ .Lang }}">
{{ if .IsPage }}
  {{ if not .PublishDate.IsZero }}
    <meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05" }}">
  {{ end }}
  {{ if not .Lastmod.IsZero }}
    <meta property="article:modified_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05" }}">
  {{ end }}
  {{ if not .ExpiryDate.IsZero }}
    <meta property="article:expiration_time" content="{{ .ExpiryDate.Format "2006-01-02T15:04:05" }}">
  {{ end }}
  {{ with .Params.categories }}
    {{ range $v := . }}
      <meta property="article:section" content="{{ $v }}">
    {{ end }}
  {{ end }}
  {{ with .Params.tags }}
    {{ range $v := . }}
      <meta property="article:tag" content="{{ $v }}">
    {{ end }}
  {{ end }}
{{ end }}

<meta name="twitter:card" content="summary">
{{ with .Site.Author.twitter }}
  <meta name="twitter:site" content="@{{ . }}">
{{ end }}
{{ if .Params.twitter }}
  <meta name="twitter:creator" content="@{{ .Params.twitter }}">
{{ else if .Site.Author.twitter }}
  <meta name="twitter:creator" content="@{{ .Site.Author.twitter }}">
{{ end }}

{{ with .Site.Params.fbAppId }}
  <meta property="fb:app_id" content="{{ . }}">
{{ end }}
{{ with .Site.Params.fbAdminIds }}
  {{ range . }}
      <meta property="fb:admins" content="{{ . }}">
  {{ end }}
{{ end }}

{{ if .Scratch.Get "gravatarEmail" }}
  <meta property="og:image" content="https://www.gravatar.com/avatar/{{ (md5 (.Scratch.Get "gravatarEmail")) | urlize }}?s=640">
  <meta property="twitter:image" content="https://www.gravatar.com/avatar/{{ (md5 (.Scratch.Get "gravatarEmail")) | urlize }}?s=640">
{{ else if .Site.Author.picture }}
  <meta property="og:image" content="{{ .Site.Author.picture | absURL }}">
  <meta property="twitter:image" content="{{ .Site.Author.picture | absURL }}">
{{ end }}

{{ with .Params.gallery }}
  {{ range . }}
    <meta property="og:image" content="{{ range first 1 (split . " ") }}{{ . | absURL }}{{ end }}">
    <meta property="twitter:image" content="{{ range first 1 (split . " ") }}{{ . | absURL }}{{ end }}">
  {{ end }}
{{ end }}
{{ with .Params.coverImage }}
  <meta property="og:image" content="{{ . | absURL }}">
  <meta property="twitter:image" content="{{ . | absURL }}">
{{ end }}
{{ with .Params.thumbnailImage }}
  <meta property="og:image" content="{{ . | absURL }}">
  <meta property="twitter:image" content="{{ . | absURL }}">
{{ end }}
